/* Define to 1 if the <elf.h> and <link.h> header file exist. */
#mesondefine HAVE_EXE_INTROSPECTION
+
+/* Whether GNOME Shell is built with X11 support */
+#mesondefine HAVE_X11
+
+/* Whether GNOME Shell is built with X11 clients support */
+#mesondefine HAVE_X11_CLIENT
if have_systemd
unitconf = configuration_data()
unitconf.set('bindir', bindir)
-
- configure_file(
- input: 'org.gnome.Shell@x11.service.in',
- output: 'org.gnome.Shell@x11.service',
- configuration: unitconf,
- install_dir: systemduserunitdir
- )
+ supported_sessions = ['wayland']
+ if have_x11
+ configure_file(
+ input: 'org.gnome.Shell@x11.service.in',
+ output: 'org.gnome.Shell@x11.service',
+ configuration: unitconf,
+ install_dir: systemduserunitdir
+ )
+ supported_sessions += ['x11']
+ endif
configure_file(
input: 'org.gnome.Shell@wayland.service.in',
install_dir: systemduserunitdir
)
- units = files('org.gnome.Shell.target',
- 'org.gnome.Shell-disable-extensions.service')
+
+ units = files('org.gnome.Shell-disable-extensions.service')
+ targetconf = configuration_data()
+ sessions_wants = []
+ foreach session: supported_sessions
+ sessions_wants += 'org.gnome.Shell@' + session + '.service'
+ endforeach
+ targetconf.set('SUPPORTED_SESSIONS', ' '.join(sessions_wants))
+ target = configure_file(
+ input: 'org.gnome.Shell.target.in',
+ output: 'org.gnome.Shell.target',
+ configuration: targetconf
+ )
+ units += target
install_data(units, install_dir: systemduserunitdir)
endif
+++ /dev/null
-[Unit]
-Description=GNOME Shell
-DefaultDependencies=no
-
-Requisite=gnome-session-initialized.target
-PartOf=gnome-session-initialized.target
-Before=gnome-session-initialized.target
-
-Wants=org.gnome.Shell@wayland.service
-Wants=org.gnome.Shell@x11.service
--- /dev/null
+[Unit]
+Description=GNOME Shell
+DefaultDependencies=no
+
+Requisite=gnome-session-initialized.target
+PartOf=gnome-session-initialized.target
+Before=gnome-session-initialized.target
+
+Wants=@SUPPORTED_SESSIONS@
\ No newline at end of file
mutter_dep = dependency(libmutter_pc, version: mutter_req)
polkit_dep = dependency('polkit-agent-1', version: polkit_req)
ibus_dep = dependency('ibus-1.0', version: ibus_req)
-x11_dep = dependency('x11')
schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req)
gnome_desktop_dep = dependency('gnome-desktop-4', version: gnome_desktop_req)
+have_x11 = mutter_dep.get_variable('have_x11') == 'true'
+have_x11_client = mutter_dep.get_variable('have_x11_client') == 'true'
+if have_x11_client or have_x11
+ x11_dep = dependency('x11')
+endif
+
+
nm_deps = []
if get_option('networkmanager')
nm_deps += dependency('libnm', version: nm_req)
cdata.set('HAVE_NETWORKMANAGER', have_networkmanager)
cdata.set('HAVE_PIPEWIRE', have_pipewire)
cdata.set('HAVE_SYSTEMD', have_systemd)
+cdata.set('HAVE_X11', have_x11)
+cdata.set('HAVE_X11_CLIENT', have_x11_client)
cdata.set('HAVE_FDWALK', cc.has_function('fdwalk'))
cdata.set('HAVE_MALLINFO', cc.has_function('mallinfo'))
subdir('po')
subdir('data')
-if get_option('tests')
+if get_option('tests') and have_x11_client
subdir('tests')
endif
meson.add_dist_script('meson/check-version.py', meson.project_version(), 'NEWS')
summary_options = {
+ 'x11': have_x11,
+ 'x11_client': have_x11_client,
'camera_monitor': get_option('camera_monitor'),
'networkmanager': get_option('networkmanager'),
'systemd': get_option('systemd'),
subdir('calendar-server')
subdir('hotplug-sniffer')
subdir('st')
-subdir('tray')
+if have_x11_client
+ subdir('tray')
+endif
script_data = configuration_data()
script_data.set('bindir', bindir)
gcr_dep,
libsystemd_dep,
libpipewire_dep,
- x11_dep,
]
+if have_x11_client
+ gnome_shell_deps += x11_dep
+endif
+
gnome_shell_deps += nm_deps
tools_cflags = '-DLOCALEDIR="@0@"'.format(localedir)
'shell-screenshot.h',
'shell-square-bin.h',
'shell-stack.h',
- 'shell-tray-icon.h',
- 'shell-tray-manager.h',
'shell-util.h',
'shell-window-preview.h',
'shell-window-preview-layout.h',
'shell-workspace-background.h'
]
+if have_x11_client
+ libshell_public_headers += [
+ 'shell-tray-icon.h',
+ 'shell-tray-manager.h',
+ ]
+endif
+
if have_networkmanager
libshell_public_headers += 'shell-network-agent.h'
endif
'shell-app-cache-private.h',
'shell-app-system-private.h',
'shell-global-private.h',
- 'shell-tray-icon-private.h',
'shell-window-tracker-private.h',
'shell-wm-private.h'
]
+if have_x11_client
+ libshell_private_headers += [
+ 'shell-tray-icon-private.h',
+ ]
+endif
+
libshell_sources = [
'gnome-shell-plugin.c',
'shell-app.c',
'shell-secure-text-buffer.h',
'shell-square-bin.c',
'shell-stack.c',
- 'shell-tray-icon.c',
- 'shell-tray-manager.c',
'shell-util.c',
'shell-window-preview.c',
'shell-window-preview-layout.c',
'shell-workspace-background.c'
]
+if have_x11_client
+ libshell_sources += [
+ 'shell-tray-icon.c',
+ 'shell-tray-manager.c',
+ ]
+endif
+
if have_networkmanager
libshell_sources += 'shell-network-agent.c'
endif
libshell_no_gir_sources += dbus_generated
+libshell_link_with = []
+if have_x11_client
+ libshell_link_with += [libtray]
+endif
+
libshell = library('shell-' + mutter_api_version,
sources: libshell_gir_sources + libshell_no_gir_sources,
dependencies: gnome_shell_deps + [libshell_menu_dep, libst_dep, mutter_dep, gnome_desktop_dep, m_dep],
include_directories: [conf_inc, st_inc, include_directories('tray')],
c_args: gnome_shell_cflags,
- link_with: [libtray],
+ link_with: libshell_link_with,
build_rpath: mutter_typelibdir,
install_rpath: install_rpath,
install_dir: pkglibdir,
#endif
#include <locale.h>
-#include <X11/extensions/Xfixes.h>
#include <gio/gio.h>
#include <girepository.h>
#include <meta/meta-backend.h>
#include <meta/meta-cursor-tracker.h>
#include <meta/meta-settings.h>
#include <meta/meta-workspace-manager.h>
-#include <meta/meta-x11-display.h>
#include <mtk/mtk.h>
+#ifdef HAVE_X11
+#include <meta/meta-x11-display.h>
+#include <X11/extensions/Xfixes.h>
+#endif
+
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-systemd.h>
MetaDisplay *meta_display;
MetaCompositor *compositor;
MetaWorkspaceManager *workspace_manager;
+#ifdef HAVE_X11
Display *xdisplay;
- char *session_mode;
XserverRegion input_region;
+#endif
+
+ char *session_mode;
GjsContext *js_context;
MetaPlugin *plugin;
path = g_strdup_printf ("%s/gnome-shell/runtime-state-%s.%s",
g_get_user_runtime_dir (),
byteorder_string,
- XDisplayName (NULL));
+ g_getenv ("DISPLAY"));
(void) g_mkdir_with_parents (path, 0700);
global->runtime_state_path = g_file_new_for_path (path);
g_free (path);
g_clear_object (&self->js_context);
}
-static void
-sync_input_region (ShellGlobal *global)
-{
- MetaDisplay *display = global->meta_display;
- MetaX11Display *x11_display = meta_display_get_x11_display (display);
-
- meta_x11_display_set_stage_input_region (x11_display, global->input_region);
-}
-
/**
* shell_global_set_stage_input_region:
* @global: the #ShellGlobal
shell_global_set_stage_input_region (ShellGlobal *global,
GSList *rectangles)
{
+#ifdef HAVE_X11
MtkRectangle *rect;
XRectangle *rects;
int nrects, i;
GSList *r;
+ MetaDisplay *display;
+ MetaX11Display *x11_display;
g_return_if_fail (SHELL_IS_GLOBAL (global));
if (meta_is_wayland_compositor ())
return;
+ display = global->meta_display;
+ x11_display = meta_display_get_x11_display (display);
nrects = g_slist_length (rectangles);
rects = g_new (XRectangle, nrects);
for (r = rectangles, i = 0; r; r = r->next, i++)
global->input_region = XFixesCreateRegion (global->xdisplay, rects, nrects);
g_free (rects);
- sync_input_region (global);
+ meta_x11_display_set_stage_input_region (x11_display, global->input_region);
+#endif
}
/**
use_ibeam ? META_CURSOR_IBEAM : META_CURSOR_DEFAULT);
}
+#ifdef HAVE_X11
static void
on_x11_display_closed (MetaDisplay *display,
ShellGlobal *global)
{
g_signal_handlers_disconnect_by_data (global->stage, global);
}
+#endif
void
_shell_global_set_plugin (ShellGlobal *global,
global->stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
+#ifdef HAVE_X11
if (!meta_is_wayland_compositor ())
{
MetaX11Display *x11_display = meta_display_get_x11_display (display);
global->xdisplay = meta_x11_display_get_xdisplay (x11_display);
}
+#endif
st_entry_set_cursor_func (entry_cursor_func, global);
st_clipboard_set_selection (meta_display_get_selection (display));
"End of frame, possibly including swap time",
"");
+#ifdef HAVE_X11
if (global->xdisplay)
g_signal_connect_object (global->meta_display, "x11-display-closing",
G_CALLBACK (on_x11_display_closed), global, 0);
+#endif
backend = meta_context_get_backend (shell_global_get_context (global));
settings = meta_backend_get_settings (backend);
/**
* shell_global_reexec_self:
* @global: A #ShellGlobal
- *
- * Restart the current process. Only intended for development purposes.
+ *
+ * Restart the current process. Only intended for development purposes.
*/
-void
+void
shell_global_reexec_self (ShellGlobal *global)
{
GPtrArray *arr;
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <meta/meta-context.h>
#include <meta/display.h>
+#ifdef HAVE_X11_CLIENT
#include <meta/meta-x11-display.h>
+#endif
#include <locale.h>
#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
shell_util_has_x11_display_extension (MetaDisplay *display,
const char *extension)
{
+#ifdef HAVE_X11_CLIENT
MetaX11Display *x11_display;
Display *xdisplay;
int op, event, error;
xdisplay = meta_x11_display_get_xdisplay (x11_display);
return XQueryExtension (xdisplay, extension, &op, &event, &error);
+#else
+ return FALSE;
+#endif
}
/**
#include <stdlib.h>
#include <meta/display.h>
-#include <meta/group.h>
#include <meta/util.h>
#include <meta/window.h>
#include <meta/meta-workspace-manager.h>
#include <meta/meta-startup-notification.h>
+#ifdef HAVE_X11_CLIENT
+#include <meta/meta-x11-group.h>
+#endif
#include "shell-window-tracker-private.h"
#include "shell-app-private.h"
get_app_from_window_group (ShellWindowTracker *tracker,
MetaWindow *window)
{
+#ifdef HAVE_X11_CLIENT
ShellApp *result;
GSList *group_windows;
MetaGroup *group;
GSList *iter;
+ if (meta_window_get_client_type (window) != META_WINDOW_CLIENT_TYPE_X11)
+ return NULL;
+
group = meta_window_x11_get_group (window);
if (group == NULL)
return NULL;
g_object_ref (result);
return result;
+#else
+ return NULL;
+#endif
}
/*
/* If we didn't get a startup-notification match, see if we matched
* any other windows in the group.
*/
- if (result == NULL && meta_window_get_client_type (window) == META_WINDOW_CLIENT_TYPE_X11)
+ if (result == NULL)
result = get_app_from_window_group (tracker, window);
/* Our last resort - we create a fake app from the window */
sources: st_enums[1]
)
-if get_option('tests')
+if get_option('tests') and have_x11_client
mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req)
test_theme = executable('test-theme',
sources: 'test-theme.c',